<template>
  <div>
    <my-search :payload="payload" :search="fetchList" :data="data"></my-search>
  </div>
</template>

<script>
  import {MySearch} from 'kuan-bear-vue'

  export default {
    data() {
      return {
        data: {
          'a': '哈哈哈1',
          'b': '哈哈哈2',
          'c': '哈哈哈3',
          'd': '哈哈哈4'
        },
        payload: {}
      }
    },
    methods: {
      test() {
        this.payload.page += 1
        this.fetchList()
      },
      fetchList(payload) {
        this.payload = {...this.payload, ...payload}
        this.saveParams(payload)
      }
    },
    mounted() {
      this.fetchList(this.payload)
    },
    components: {
      MySearch
    }
  }
</script>
